<div ng-if="wxappid">
    <form name="myForm" enctype="multipart/form-data">
        <fieldset>
            <legend>{{"Upload files"|translate}}</legend>
            <input type="file" ngf-select ng-model="picFile" name="file" accept="{{acceptTypeStr}}" ngf-max-size="2MB" required ngf-model-invalid="errorFile">
            <!-- <i ng-show="myForm.file.$error.required" class="sui-text-warning">*必选</i> -->
            <div class="sui-progress" ng-show="picFile.progress >= 0" style="margin-top: 5px;margin-bottom: 5px;">
                <div style="width:{{picFile.progress}}%" class="bar" ng-bind="picFile.progress + '%'"></div>
            </div>
            <button class="sui-btn btn-small btn-primary" ng-disabled="!myForm.$valid" ng-click="uploadPic(picFile)">{{"Upload"|translate}}</button>
            <div ng-show="myForm.file.$error.maxSize" class="sui-text-warning">文件太大 {{errorFile.size / 1000000|number:1}}MB，超过最大限制2M。</div>
            <!-- <img ng-show="myForm.file.$valid" ngf-thumbnail="picFile" class="thumb"> -->
            <!-- <button ng-click="picFile = null" ng-show="picFile">移除</button> -->
            <span ng-show="picFile.result">{{"Upload success"|translate}}</span>
            <span class="sui-text-warning" ng-show="errorMsg">{{"error"|translate}}：{{errorMsg}}</span>
        </fieldset>
        <br>
    </form>
</div>
